<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
    function page(n,s){
        $("#pageNo").val(n);
        $("#pageSize").val(s);
        $("#searchForm").submit();
        return false;
    }
</script>
<div class="content-wrap">
    <div class="wrapper" style="bottom: 50px;">
        <ul class="nav nav-tabs">
            <li class="active">
                <a href="#"   onclick="loadDiv('mainCenterDiv','${ctx}/doctor/liveRequisition/hospitalRegistr')">入院登记</a>
            </li>
        </ul>
        <section class="panel panel-default">
            <div class="panel-body">
                <div class="table-responsive no-border">
                    <div class="datatable-top">
                        <div class="pull-left">
                            <form:form id="searchForm" modelAttribute="patVisit"  onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/doctor/liveRequisition/hospitalRegistr');" method="post" class="form-inline">
                                <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
                                <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
                                <label>住院号 ：</label><form:input path="visitNo" htmlEscape="false" maxlength="50" class="form-control" /> &nbsp;&nbsp;&nbsp;
                                <label>姓名 ：</label><form:input path="patVisitIndex.name" htmlEscape="false" maxlength="50" class="form-control" /> &nbsp;&nbsp;&nbsp;
                                <label>身份证号 ：</label><form:input path="patVisitIndex.idNo" htmlEscape="false" maxlength="50" class="form-control" /> &nbsp;&nbsp;&nbsp;

                                &nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                &nbsp;<input id="btnReg" class="btn btn-primary" type="button" onclick="loadDiv('mainCenterDiv','${ctx}/doctor/liveRequisition/hospitalRegistrFrom')" value="登记"/>
                            </form:form>
                        </div>
                    </div>
                    <table id="contentTable" class="table table-bordered mg-t datatable">
                        <thead>
                        <tr>
                            <th>序号</th>
                            <th>住院号</th>
                            <th>姓名</th>
                            <th>年龄</th>
                            <th>性别</th>
                            <th>身份证号</th>
                            <th>入院日期</th>
                            <th>入院科室</th>
                            <th>入院病区</th>
                            <th>费别</th>
                            <th>出生地</th>
                            <th>操作员</th>
                            <th>登记时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${page.list}" var="patVisit" varStatus="coun">
                            <tr>
                                <td> ${coun.count} </td>
                                <td> ${patVisit.visitNo} </td>
                                <td> ${patVisit.patVisitIndex.name} </td>
                                <td> ${patVisit.patVisitIndex.age} </td>
                                <td> ${fns:getDictLabels(patVisit.patVisitIndex.sex, 'SEX_DICT', '')} </td>
                                <td> ${patVisit.patVisitIndex.idNo} </td>
                                <td> <fmt:formatDate value="${patVisit.admissionDate}" pattern="yyyy-MM-dd" /></td>
                                <td> ${fns:getDeptName(patVisit.deptAdmissionTo ,'')} </td>
                                <td> ${fns:getDeptName(patVisit.wardAdmissionTo,'')} </td>

                                <td> ${fns:getDictLabels(patVisit.patVisitIndex.chargeType,'CHARGE_TYPE_DICT','')} </td>
                                <td> ${patVisit.patVisitIndex.homeplace} </td>
                                <td> ${fns:getUserName(patVisit.createBy.id)} </td>
                                <td> <fmt:formatDate value="${patVisit.createDate}" pattern="yyyy-MM-dd HH:mm" /></td>
                                <td>
                                    <a href="#" onclick="loadDiv('mainCenterDiv','${ctx}/doctor/patVisitIndex/updatePatientInfo?id=${patVisit.patVisitIndex.id}')" class="btn btn-success btn-xs">修改</a>
                                    <a href="#" class="applyBt btn btn-info btn-xs"
                                       onclick="confirmExtend('确定要取消登记该病人登记信息？',function(){delLoad('mainCenterDiv','${ctx}/oper/patMasterIndex/cancelRegister?id=${patVisit.patientId}','${ctx}/doctor/liveRequisition/hospitalRegistr')})">取消登记</a>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                    <div class="pagination">${page}</div>
                </div>
            </div>
        </section>
    </div>
</div>